<template>
  <span slot="description">{{filterWork}}
    <span slot="description" class="green" v-if="filterWork.endnum"> 已完成{{ filterWork.endnum }}</span>
    <span slot="description" :class="{ red: filterWork.endnum && filterWork.noendnum }">
      {{ filterWork.noendnum ? `未完成 ${filterWork.noendnum}` : '无任务' }}</span
    >
  </span>
</template>

<script>
export default {
  name: 'HomeStep',
  props: {
    title: {
      type: String,
      default: '',
    },
    list: { type: Array, default:()=> [] },
  },
  watch:{
    list(a,b){
      console.log('%c [ a ]-25', 'font-size:13px; background:pink; color:#bf2c9f;', a,this.filterWork)

    }
  },
  created(){
console.log('%c [ a ]-25', 'font-size:13px; background:pink; color:#bf2c9f;', this.list)
  },
  computed: {
    filterWork() {
      const endnum = this.list.filter((item) => item.ENDNUM == '1').length
      const noendnum = this.list.filter((item) => item.NOENDNUM == '1').length
      return { endnum, noendnum }
    },
  },
}
</script>

<style>
</style>